<ul class="dux-tab uk-clearfix">
    <li class="active">
        <a href="{url('index')}">账户充值</a>
    </li>
    <li class="">
        <a href="{url('log')}">充值记录</a>
    </li>
</ul>

<div class="dux-tab-body">
        <form class="uk-padding dux-form uk-form  uk-form-horizontal">
            <div class="uk-form-group">
                <label class="uk-form-label">充值金额</label>
                <div class="uk-form-controls uk-form-controls-text">
                    <input type="tel" name="money" placeholder="请输入充值金额">
                    <div class="uk-form-help">充值单位:元</div>
                </div>
            </div>
            <div class="uk-form-group">
                <label class="uk-form-label">充值方式</label>
                <div class="uk-form-controls uk-form-controls-text">
                    <div class="uk-grid">
                    <!--php{$i = 0}-->
                    <!--loop{$payList as $type => $vo}-->
                    <!--php{$i++}-->
                    <label>
                        <input type="radio" name="type" value="{$type}" {$i == 1 ? 'checked' : 0}  >{$vo.name}
                    </label>
                    <!--{/loop}-->
                    </div>
                </div>
            </div>

            <!--if{$offline}-->
            <div class="uk-form-group">
                <label class="uk-form-label">线下充值</label>
                <div class="uk-form-controls uk-form-controls-text">
                    {$offline}
                </div>
            </div>
            <!--{/if}-->

            <div class="uk-form-group">
                <div class="uk-form-controls uk-form-controls-text ">
                    <button type="button" class="uk-button uk-button-primary" id="pay">确认充值</button>
                </div>
            </div>
        </form>
</div>

<script>
    Do('base', function () {
        $('#pay').click(function () {
            app.ajax({
                url: '{url()}',
                type: 'post',
                data: {
                    type: $('[name=type]:checked').val(),
                    money: $('[name=money]').val()
                },
                success: function (msg, url) {
                    window.location.href = url;
                },
                error: function (msg) {
                    app.error(msg);
                }
            });
        });
    });
</script>